[Entity Store] Add more granular distributions#352
Merged
Conversation
ymao1
approved these changes
Apr 7, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Extends the entity_store_perf tooling to support more controllable entity-type mixes when generating perf data, adds optional metrics sampling during single-file uploads, aligns generated document shape so only generic entities emit a top-level ECS entity object, and updates the Entity Store V2 install call to use the public Kibana API path/version.
Changes:
- Add
--distribution absoluteplus--{user,host,service,generic}-countflags and validation plumbing for perf data generation. - Add
--metrics,--samplingInterval, and--transformTimeouttoupload-perf-data, with periodic cluster/node/Kibana (and optionally transform) metrics logging andfinallycleanup. - Switch Entity Store V2 install to
/api/security/entity_store/installand use the public v1 API version header; adjust entity types/docs to be generic-only for top-levelentity.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/kibana_api.ts | Updates Entity Store V2 install to public path and public API version header. |
| src/constants.ts | Changes the Entity Store V2 install URL constant to the public /api/... endpoint. |
| src/types/entities.ts | Updates entity document TS types so only generic entities have top-level entity. |
| src/commands/entity_store_perf/README.md | Documents new distribution options and upload metrics flags. |
| src/commands/entity_store_perf/index.ts | Wires new CLI flags for absolute distribution and upload metrics options. |
| src/commands/entity_store_perf/entity_store_perf.ts | Implements explicit-count distribution validation, generic-only entity shape, and metrics-mode logging + transform wait during upload. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extends the
entity_store_perfworkflow with explicit entity mix controls, optional metrics collection during single-file upload, aligns generated document shape with generic-only ECSentity, and updates Entity Store V2 install to use the public Kibana API path and version.Functional changes
create-perf-data--distribution absolute: You can fix exact counts per entity type with--user-count,--host-count,--service-count, and--generic-count. All four are required, must be non-negative integers, and must sum exactly to<entity-count>.equal(25% each type, remainder to service) andstandard(≈33% user/host/generic, ~1% service) still work; the--*-countflags are rejected unless distribution isabsolute.entityobject is emitted only for generic entities. User, host, and service documents rely on their respective ECS fields (user,host,service) without a duplicate top-levelentityblock. Type definitions insrc/types/entities.tsmatch this shape.upload-perf-data--metrics: While uploading, periodically writes the same style of metrics logs under./logsas interval mode (cluster health, node stats, Kibana stats; transform stats when not in--noTransformsmode).--samplingInterval <seconds>: Metrics sampling period when--metricsis on (default: 5).--transformTimeout <minutes>: In metrics mode with transforms (V1 flow), waits up to this long for the generic transform to catch up to the uploaded document count before finishing; logs a warning and continues on timeout (default: 30).--noTransforms: Transform polling is skipped in metrics mode (V2 / ESQL path unchanged in spirit).Cleanup of metrics loggers is done in a
finallyblock so intervals stop even if upload or counting fails.Entity Store V2 install (Kibana)
/internal/security/entity_store/installto/api/security/entity_store/install.apiVersion=2query param on the path).